//package com.publicstaticdroid.g2l_interpreter_connect;
//
//
//import android.content.Context;
//import android.content.Intent;
//import android.telephony.PhoneNumberUtils;
//import android.util.Log;
//
//
///**
// * 
// * @author Nathan Breit
// *
// */
//class SMSCallReceiver extends SMSReceiver
//{
//
//	@Override
//	protected void callCommand(Context c, String phoneNumber, int requestID,
//			String phoneNumberToCall) {
//		String parsedPhoneNumberToCall = PhoneNumberUtils.extractNetworkPortion(phoneNumberToCall);
//		if (PhoneNumberUtils.isGlobalPhoneNumber(parsedPhoneNumberToCall))
//		{
//			if (PhoneNumberUtils.isEmergencyNumber(parsedPhoneNumberToCall))
//			{
//				Log.e(LOG_TAG, "Discarding message: we will NOT auto-dial 911");
//				return;
//			}
//		}
//
//		parsedPhoneNumberToCall = "tel:" + Constants.BLOCK_CALLER_ID + PhoneNumberUtils.formatNumber(parsedPhoneNumberToCall);
//		Intent makeCallIntent = new Intent(c, MakeCallActivity.class);
//		makeCallIntent.addFlags(Intent.FLAG_FROM_BACKGROUND);
//		makeCallIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
//		makeCallIntent.putExtra("numberToCall", parsedPhoneNumberToCall);
//		makeCallIntent.putExtra("requestID", requestID);
//
//		c.startActivity(makeCallIntent);
//
//		Log.i(SMSReceiver.LOG_TAG, "Dialed " + parsedPhoneNumberToCall + " for request id " + requestID);
//	}
//	@Override
//	protected void dismissRequest(Context c, String phoneNumber, int requestID) {
//		super.dismissRequest(c, phoneNumber, requestID);
//		
//		
//
//		// Display Toast notification that someone else handled this request
//		//String noticeString = "Someone else has answered that interpreting request!";
//		//Toast.makeText(c, noticeString, Toast.LENGTH_LONG).show();
//		// cancel the corresponding NeedAnInterpreter.class accept/reject dialog, if it exists
//		// commented out because it (1) didn't actually work and (2) needlessly brought the app to the front
//		//					Intent cancelRequest = new Intent(currentContext, NeedAnInterpreter.class);
//		//					cancelRequest.putExtra("cancel", true);
//		//					cancelRequest.putExtra("requestID", words[1]);
//		//					cancelRequest.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//		//					currentContext.startActivity(cancelRequest);
//
//		//Nathan: Do we need to cancel the accept/reject dialog?
//		//		  I'm guessing this in an issue only when the user has already opened the notification.
//
//		// TODO: Look at using timeout to get rid of notifications
//	}
//}
